Redux, useSelector, useDispatch


用 hooks 取代 connect

connect => hooks
取資料: mapStateToProps => useSelector
更新資料: mapDispatchToProps => useDispatch

import { Provider, useSelector, useDispatch } from 'react-redux';
import { addTodo } from './action/todolist';







你可能感興趣的文章

第五天:爬蟲【三】

第五天:爬蟲【三】

Day 71

Day 71

關於產品開發,PRD 的作用與內容介紹

關於產品開發,PRD 的作用與內容介紹






留言討論